import { createRouter, createWebHashHistory } from 'vue-router'

const Home = () => import("@/pages/home.vue")
const Index = () => import("@/pages/index.vue")

// 图书阅览模块
const bookBrowsing = () => import('@/pages/bookBrowsing/bookBrowsing.vue')
const seatChoose = () => import('@/pages/bookBrowsing/seatChoose.vue')
const vipManagement = () => { import('@/pages/bookBrowsing/vipManagement.vue') }
const readingCorner = () => { import('@/pages/bookBrowsing/readingCorner.vue') }
const vipBookStore = () => { import('@/pages/bookBrowsing/vipBookStore.vue') }
const themeDiscuss = () => { import('@/pages/bookBrowsing/themeDiscuss.vue') }


const routes = [
    {
        path: '/',
        component: Index,
        name: 'index',
        redirect: 'home',
        children: [
            { path: 'home', component: Home },
            {
                path: 'bookBrowsing', component: bookBrowsing, children: [
                    { path: 'seatChoose', component: seatChoose },
                    { path: 'vipManagement', component: vipManagement },
                    {
                        path: 'readingCorner', component: readingCorner, children: [
                            { path: 'vipBookStore', component: vipBookStore },
                            { path: 'themeDiscuss', component: themeDiscuss }
                        ]
                    }
                ]
            }
        ]
    }
]

const router = createRouter({
    routes,
    history: createWebHashHistory()
})


export default router